package com.xjgzinfo.usdp.service.dto;

import com.xjgzinfo.usdp.jpa.service.Criteria;
import com.xjgzinfo.usdp.jpa.service.filter.*;

import java.io.Serializable;
import java.util.Objects;

/**
 * Criteria class for the {@link com.xjgzinfo.usdp.domain.ImgAssets} entity. This class is used
 * in {@link com.xjgzinfo.usdp.web.rest.ImgAssetsResource} to receive all the possible filtering options from
 * the Http GET request parameters.
 * For example the following could be a valid request:
 * {@code /img-assets?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
 * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
 * fix type specific filters.
 */
public class ImgAssetsCriteria implements Serializable, Criteria {

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private StringFilter name;

    private StringFilter type;

    private StringFilter createUser;

    private InstantFilter createDate;

    private BooleanFilter isPublic;

    private LongFilter userId;

    private IntegerFilter isDeleted;

    public ImgAssetsCriteria() {
    }

    public ImgAssetsCriteria(ImgAssetsCriteria other) {
        this.id = other.id == null ? null : other.id.copy();
        this.name = other.name == null ? null : other.name.copy();
        this.type = other.type == null ? null : other.type.copy();
        this.createUser = other.createUser == null ? null : other.createUser.copy();
        this.createDate = other.createDate == null ? null : other.createDate.copy();
        this.isPublic = other.isPublic == null ? null : other.isPublic.copy();
        this.userId = other.userId == null ? null : other.userId.copy();
        this.isDeleted = other.isDeleted == null ? null : other.isDeleted.copy();
    }

    @Override
    public ImgAssetsCriteria copy() {
        return new ImgAssetsCriteria(this);
    }

    public LongFilter getId() {
        return id;
    }

    public void setId(LongFilter id) {
        this.id = id;
    }

    public StringFilter getName() {
        return name;
    }

    public void setName(StringFilter name) {
        this.name = name;
    }

    public StringFilter getType() {
        return type;
    }

    public void setType(StringFilter type) {
        this.type = type;
    }

    public StringFilter getCreateUser() {
        return createUser;
    }

    public void setCreateUser(StringFilter createUser) {
        this.createUser = createUser;
    }

    public InstantFilter getCreateDate() {
        return createDate;
    }

    public void setCreateDate(InstantFilter createDate) {
        this.createDate = createDate;
    }

    public BooleanFilter getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(BooleanFilter isPublic) {
        this.isPublic = isPublic;
    }

    public LongFilter getUserId() {
        return userId;
    }

    public void setUserId(LongFilter userId) {
        this.userId = userId;
    }


    public IntegerFilter getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(IntegerFilter isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final ImgAssetsCriteria that = (ImgAssetsCriteria) o;
        return
                Objects.equals(id, that.id) &&
                        Objects.equals(name, that.name) &&
                        Objects.equals(type, that.type) &&
                        Objects.equals(createUser, that.createUser) &&
                        Objects.equals(createDate, that.createDate) &&
                        Objects.equals(isPublic, that.isPublic) &&
                        Objects.equals(userId, that.userId) &&
                        Objects.equals(isDeleted, that.isDeleted);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                id,
                name,
                type,
                createUser,
                createDate,
                isPublic,
                userId,
                isDeleted
        );
    }

    // prettier-ignore
    @Override
    public String toString() {
        return "ImgAssetsCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (name != null ? "name=" + name + ", " : "") +
                (type != null ? "type=" + type + ", " : "") +
                (createUser != null ? "createUser=" + createUser + ", " : "") +
                (createDate != null ? "createDate=" + createDate + ", " : "") +
                (isPublic != null ? "isPublic=" + isPublic + ", " : "") +
                (userId != null ? "userId=" + userId + ", " : "") +
                (isDeleted != null ? "enabled=" + isDeleted + ", " : "") +
                "}";
    }

}
